package com.lonwin.inspectionmanagement.mvp.ui.adapter;

import android.app.Activity;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.lonwin.inspectionmanagement.R;
import com.lonwin.inspectionmanagement.mvp.ui.fragment.NoSortOutRecordFragment;
import com.lonwin.inspectionmanagement.mvp.ui.fragment.SortOutRecordFragment;

import java.util.ArrayList;
import java.util.List;

public class NewCruiseRecordTabAdapter extends FragmentPagerAdapter {

    private String[] TITLES;
    private Activity activity;
    private List<Fragment> fragments=new ArrayList<>();
    public NewCruiseRecordTabAdapter(FragmentManager fm, Activity mactivity) {
        super(fm);
        activity=mactivity;
            TITLES = activity.getResources().getStringArray(R.array.vehicle_violation_tab);
        fragments.add(NoSortOutRecordFragment.newInstance());
        fragments.add(SortOutRecordFragment.newInstance());
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return TITLES[position];
    }

    @Override
    public int getCount() {
        return TITLES.length;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);

    }


}